Fixed the bug. Apparently, copying a variable into a lambda makes it a constant