fixed an issue with truncating doubles