add algorithm for check availability, session needed