bug fixing on loading