change transition method to model using DOM instead of glob variable