Added more user error checking