fixed code after merging