fixed missing ->end()