fix to issue#1. null pointer exception