added test + minor fix