Adds check for session before initializing it