don't start new session if already started
fix problem with ResultIterator
add possibility to change the layout in controllers