This code block has to run in a background thread else it will block the UI from 50ms to a couple of seconds.