added more better wait method