functional bugs fixed