Fix for the race condition

This is my change to better deal with multiple files. This change is done within the Utils.java file and leaves the method calls untouched.