Fixing bug with parent