fix map file and load function