menu control added
error check added for ajax requests