added res end