Updating code due to bug in chrome