fixed bug in setting the parent element correctly

There's a bug in setting the parent element according to the options. When the parent element is provided in the options it is being set to 'true' instead of the actual element.