Fixed bug that was causing 500 error on page load.