fixing a undefined error