Fixed the loop using tail --pid