fixed the bug, works great now