Added more error checks in jquery to provide a more powerful UX of
department page, employee page, job title page.