Fix bug in UP