Made sure that necessary fields in data/session exist before attempting to operate on them