fixed bugs to allow remote deploy