Added dont-submit option and made setup more robust