[INTERNAL] cleanup, handle faulty input