Attempt #2 getting template wrapping from server side, still has a bug