Added js variable to handle http 500 errors