fix bug when loading levels