added resource damping and prevent resource out of bounds