Changed code for loading