fixed critical sonar warnings