adapted to the new API modifications