Fix custom template prompt showing "undefined"