added error message to my javascript