adpated to new core apis