at a guess it'll be because you have the function running twice?