Fixed compatibility with API v7