made tweaks to the mainhndler