Added more error handling for helpdesk and a bit of code cleanup