fixed detected bugs by findbugs