make galaxy script more robust against failure