handle empty string case in stat