changed getvalue to trywait