fixing various bugs
fixing various bugs