main design bugs fixed