Updated write logic for empty cached results

Cleaned up conditional statements and empty cache results write