Nicer dispose method

check for non-null , etc