Your script is not compatible with Contao 4.