fixed error with print_state