Change to timeout function (Preliminaly version)