Change way of forking sessions and logging