fixed missing variable error