Addapted to sdk2