rewrite success, add error call