fix naming issue and add case if user enter spaces