Fixed  bugs