removed dubplicate code