fix profile name validation and add  test