Fixed bug from sonar