fixing undefined keys in widget template