Fixed incorrect assignment error. But now generating wrong code