udpated the code bug fixes