fixed errors with loading and memory spaces