fixed small bug in legacy