added check for gem so that it tries with tbody, then without