fixed a few bugs with loading only when needed