[fix] removed code that was throwing an error in some cases and doing nothing in others