What is use of check_user method? you are checking "duplicate user" client side only?