rewritting code for the achievemnts controller