fixing small bug causing 2 error messages to show