fixed some sonar errors