card drawing and some bugs fixed