bug fixed #235: fixed null pointer exception