fixes #7: set type before calling super