add tests

- fix multiple calls
- refactor to remove ready variable