Added Thread.sleep() as per Grant's suggestion. Thanks!