fix bugs causing crash in user loader