Weapon Pickup help needed!

Does aiming mode work normally if you don’t aim while picking something up? Meaning, can you aim/unaim when you press/release the right mouse button?

ok so ive implemented an item iteract/pickup system for weapons and it works fine picking up items, ive also added an aiming mode so when you pick up weapon off the ground you hit r mouse to enter aiming mode, only problem is if I hit interact/pickup key (e) whilst in aiming mode (right mouse button) it will put the weapon on his back in holster but will stay in aiming mode. can anyone please help, its probably an easy fix but ive been debugging for hours and cant find it!
if theres anything else I need to show no problem, I’m pretty new but I thought it must have something to do with the attached screenshots
alt text