CSS transition bug fix