exec works without end function