fixed sonar code violations