make and insert error fnc