Added file exists check