fixed error for "Can't use method return value in write context"

Without this change PHP throws an error:

> Can't use method return value in write context


For notes on why the `empty()` function is not necessary see http://stackoverflow.com/questions/1075534/cant-use-method-return-value-in-write-context