* Fixed the scoping issues

#FIXME: this has a non termination error

#TODO: streamlining the error system?