update error message on wrong type