fixed sonar warnings