lost of little changes to get things actually working after creation from template