added a better wait for parser