Trying to bug fix but causing more problems