The exception to the above advice is if travel is on separate tickets. Then you'll need to clear immigration and customs and recheck in. In this case 2 hours is a bit tight (especially if travel is after UA moves to T2 when a change of terminals is also required).