return 1 on error