Fixed the bug, actually works now