fix sonar critical issues cont'd