added condition for updating all session ids
changed how version is determined