when creating a new instance, automatically add an alarm that closes the instance again if it was idle for a while. If it fails to add an alarm, terminate the instance immediately