Added logic to override the input state