close the connection
check for not null