add tests and some checks