Changed to running as loop