fixed some integration bugs