very lame npe fix, should do something better!