Changed wait for realbutton fro a loop