fixing bugs (partially)