added patch for printing states