changes imported from Parag on Tripsy