Use WRITEDATA instead of WRITEFUNCTION for new code