fixed warnings via cast