added test and corrected missing assignment