fixed code according to coding guidelines