changed the runtime exception to bad credentials for 500 error