added checks for proper input from user.