Fix undefined index error for session var