fix for last commit, added tests