Use error emit instead of callback