fix double function