Mame forgets the joyput input everystime i restart it.

I start a game, go into input config and set my joystick buttons, after i exit the game it forgets them and i have to do it all over again.

EDIT: Nevermind i just have to set the cfg path in the mame.cfg