chmod 0777 is not nice. should be configurable.