fix

Add line to wait for the RAM buffer to be avaliable

- wait_for_flushing and wait_for_migration now takes id
  as the 2nd argument