better exception prevention