fixed few small bugs