Fixing unbound var issue