reordering commands trying to workaround what seems to be a weird race condition