fixing sonar warnings