adding tamplete to database