Fixed loading bug and removed static session variable