DRY out javascript
Change error messages
Fix order of error messages
Fix Javascript