Fixing bug with wrong template