fixed bug for allow_nil in username