pre_cmd was being overwritten, use hooks instead