fixed error in tilecount