fixed some additional bugs