added todo to complement previous todo
upgraded sanity checks for better exception protection