use this instead of window. (this-as this (aget this :) )