add error callback and tested