added new options; better output when error occurs