Pass window object not function returning it