if (sources.length == 0) {
details += '<tr><td colspan="2">No sources for record!</td></tr>';
} else if (sources.length == 1) {
if (sources.length == 0) {
details += '<tr><td colspan="2">No sources for record!</td></tr>';
} else if (sources.length == 1) {