ugly code but all works now!