finally working rest adapter