need to check for null (other approach woyld be try cactch block)