replace fchmod() with chmod()