Fixed compatibility with 5.2 and 5.3