added conditional SQL file import & resource run order