Moved alert inside ajax