fixed some further bugs