don't redirect on status 500 (server error)
simpler jquery expression