changed to work with live database