Added min instance running and fix on ami check