fixing incorrect return code