fixed code analysis errors