fixed use of empty for PHP<5.5