some backend bugs fixed