changed loader db port and changed order of SQL cleanup statements