fix some issues during testing
add part of tests