use exit code as 1 when fails