change setcolordirect function to execute this functin asynchron