fixing bugs in ajax partial rendering