fixed some last bugs