fix stay functioion