addapted to sdk2