adapte to pegasus v0.8.3+