Fixed modal callbacks to work asynchronously