better debugging
fix stdin session bug