make the ls tasks a bit more robust