more robust script for working with todo