added tests
bug fix