fixing bug in loading class