for performance considerations it's probably better to move this line to after the name check