fixing trim for unsupported browsers