added instance cap parameter, fixed #4