should that not be an assertion or something? Or proper error checking.