Check for empty
minor code check and fix