added new test, fixed a small bug