Prevent exception instead of catching it