applied patch
add tests