replaced 1 with EXIT_FAILURE