replaced rtrim(ltrim()) in favor of trim() - thanks ScallioXTX