added error checking in Util