replace system function