bug fixes null pointer exception