fixing a few little bugs