added ends to res