two  bugs fixed