fixed a bug in cleaner and added specs