Code update after some bug fixes and card ui changes