attempt at fixing the first bug I fixed that got removed by a merge