added waiting to get onclick attribute