bug fixing template rendering and ui