fixed signal clear and some recursive stuff