Fix #18 check for viewstate existence