Was returning the window instead of re object