fixed some annoying bugs