slightly heavy way to prevent an exception from occuring