fixed code bug