fixing bug in logging (always check if user exists for particular session)