Attempted fix to bug