Changed app name to historyemergent, added decent error logging