fixed a bug with passed variables