Removed unecessary javascript
Producing error message without refreshing the page