fix non-object errors