changed the js so that it does an error message