bg and fg worked properly now