fixed missing variable assignment