add a return 1 in case of error