added retain_session param