fixing return on error
changed version