complement fix and unit testing