modified scope and added history log file