another check for empty s:msg before accessing it