Added check of the bad inputted value