better error viewing for dev purpose and closing session