Fixed js for checking if user exists