lot of fixes just to make things works