fixed null / empty bug