Small bug still using old variable