bug fixes on backend