make CSS transitions work properly