fix custom errors init bug