adding if empty clause to stop implode warnings