fix bug with getting property of null