Fixed an error in assignTimeslot() that fails to retrieve the count.

The assignTimeslot() function had a small mistake in the way
Hibernate executed the SELECT COUNT(*) statement which caused
the confirmation process to fail. This commit fixes that and
wraps the function in a try/catch block to handle any Hibernate
exceptions.