system id extraction fixed for possible spaces