fix non-object error