fixed an error in handle percepts