Add externalClock setting and move some calls into the try-catch brackets