Umarex XP 40 bb gun slide wont lock back when magazine is empty

I bought a Umarex XP 20, 20 shot bb gun from Pyramid Air about 2 weeks ago.. The gun is blowback and fires 20 shots. When the magazine is empty the slide is supposed to lock back. At first it did, but now it doesnt lock back when all 20 bb's are shot. If I fire 20 rounds and it doesnt lock back but if I remove the magazine and put it back in empty and fire it the slide locks back. I cant figure out why the slide wont lock back when all the bb's are fired. I bought it casue its one of the features I liked. I'm thinking of returning it and asking for a new one. I would appreciate any advise to correct the problem before I contact Pyramid.