Added a check after ajax requests (jQuery UJS)