enable templates and fixed a bug with clearing forms