thowing empty errors, but at the right times