fixed code struture