Added timeout to wait element method