fix function ATPUpdate