fixed null pointer violation