fixing error while comparing char to string