move sanity check inside install function