fixed some small bugs