bit of a hack but better then before imo