added some jquery promise() functions