restored correct functionality