-Adapted to new 1.6 API