corrected the bug added in function slot