added login and session control