fixing some undefined errors