Added check inside the loop for empty magazine