move check for session type to main method