move username checking code to verify.js