fix block counting