fix issue #4 name in DB
Fix rebuild bug - delete templates