fixes, better way to handle ref number