bugfix: error callback called twice