Main error fixed
notices fixed