some data checking / cleaning