fixed weird bugs