fix bug when loading routines