Added check to make sure instance is not nil