coorected a few bugs