question about polaris sportsman ext

I just bought a used 2015 polaris sportsman ext and for the first 4weeks I've had it, it has worked great. Now, when we first start it, we have to let it warm up for 5 minutes or so or it will die as soon as you hit the gas. It starts fine, idles fine while it's warming up, and runs great after the warm up period. Any ideas on what could cause this?