try setting a timeout function to release the ui thread