check for file existence and that it is not empty