fixed the bug I had mentioned