modified to support creating credentials file