Hopefully bug fix null pointer exception