Added dispatch for window message loop