Removed infinite looping from gapi