fixed empty() limitation issue.

ref: 

http://stackoverflow.com/questions/1075534/cant-use-method-return-value-in-write-context