name checking added

tested a bit and it looks good