Fixing invalid input