Fixed bad input bug