Added user error checking