Fix add h function

based on suggestions from Sudhanshu Chauhan and Nutan Kumar Panda