fix variable scope
more ops