fixed some problems from previous merge