made 'session is empty' check work for all prefixes