added valid bit check to load and store