some changes for ajax functionality