Fix error message, make it generic