Fix pulse close function