Fix back-end to decide active class