pass error as well