Proper fix for the previous bug