Was changed some code for preferences