Fixed the input crash bug