added ">" and file exists check