Added function to wait for element to be displayed before returning after finding an element