fixed a small bug with im2