How to check if a username is already taken

That could actually be used as a trick question for a job interview. Since the whole approach of checking for an existing username or email is wrong, you wouldn’t use anything instead of count, let alone use count. As previously explained, you build in a Race Condition by doing so.