fixing problem with "this" reference and chaging "this" to a Global escope variable "options" on some points