$error now is a bool; use $errormsg for error info