Exception handling added in UserTest